// MistakeQuestionController.java
package com.openx.xoj.controller;
import com.openx.xoj.model.entity.Question;
import com.openx.xoj.service.MistakeQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MistakeQuestionController {

    @Autowired
    private MistakeQuestionService mistakeQuestionService;

    @GetMapping("/recommendations/{userId}")
    public List<Question> getRecommendations(@PathVariable Long userId) {
        return mistakeQuestionService.recommendQuestions(userId);
    }
}
